package com.youlu.campus.entity.course;

import com.youlu.campus.base.base.EntityBase;
import lombok.Data;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;

/**
 * @author : [dengbo]
 * @className : UserCourseVideoStudy
 * @description : [课程视频学习]
 * @createTime : [2022/5/17 22:49]
 */
@Data
@Document(collection = "user_course_video_study")
@CompoundIndexes({
        @CompoundIndex(name = "idx_user_app_course_video_id", def = "{'userId':-1,'appId':1,'courseId':-1,'videoId':-1}")
})
public class UserCourseVideoStudy extends EntityBase {
    /**
     * 活动ID
     */
    @Indexed
    private String activityId;
    /**
     * 课程ID
     */
    private String courseId;
    /**
     * 视频ID
     */
    private String videoId;
    /**
     * 应用appId
     */
    private String appId;
    /**
     * 视频ID
     */
    private String userId;
    /**
     * 课程学习状态 0 未开始 1学习中 2已完成
     */
    private Integer status = 0;
    /**
     * 学习时长 默认为0,时间秒
     */
    private Integer currentDuration = 0;
    /**
     * 视频总时长 时间秒
     */
    private Integer totalDuration;
    /**
     * 开始学习日期
     */
    private LocalDateTime startTime;
    /**
     * 结束学习日期
     */
    private LocalDateTime endTime;
}
